package com.service.impl;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.dao.AdminDao;
import com.dto.EmpInfo;
import com.service.AdminService;
import com.util.PageUtil;
@Service
public class AdminServiceImpl implements AdminService {
	@Autowired
	private AdminDao ad;
	@Override//员工登录
	public EmpInfo queryEmp(EmpInfo emp) {
		return ad.queryEmp(emp);
	}
	@Override//员工查询
	public List<EmpInfo> queryEmpByPageUtil(PageUtil pu) {
		List<EmpInfo> emp=null;
		try {
			if(pu.getPageSize()==0) {
				pu.setPageSize(1);
			}
			pu.setTotalNum(ad.querytotalNum(pu));
			emp=ad.queryEmpByPageUtil(pu);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return emp;
	}
}
